import isHaveBug from '../../utils/bug';
import request from '@/utils/request'

// 查询年度考核记录列表
export function listRecord(query) {
  return request({
    url: '/hrm/record/list',
    method: 'get',
    params: query
  })
}

// 查询年度考核记录列表
export function appraiselist(queryData) {
	let query = JSON.parse(JSON.stringify(queryData))
	if (isHaveBug("HR-APP-032")){
		query.params.startDate = "";
		query.params.endDate = "";
	}
  return request({
    url: '/hrm/record/appraiselist',
    method: 'get',
    params: query
  })
}

// 查询年度考核记录详细
export function getRecord(id) {
  return request({
    url: '/hrm/record/' + id,
    method: 'get'
  })
}

// 新增年度考核记录
export function addRecord(data) {
  return request({
    url: '/hrm/record',
    method: 'post',
    data: data
  })
}

// 修改年度考核记录
export function updateRecord(data) {
  return request({
    url: '/hrm/record',
    method: 'put',
    data: data
  })
}

// 删除年度考核记录
export function delRecord(id) {
  return request({
    url: '/hrm/record/' + id,
    method: 'delete'
  })
}
